The easiest way to use the 68K Mac Debugger or the Power Macintosh Debugger is in the single machine debugging mode:
1) Compile and link your MPW application with the -sym on option (use -symbig on the Power Mac) and be sure to include a size resource with the Can Background option set.
2) launch the 68K Mac DebugServices (or the Power Mac DebugServices if you are running the Power Macintosh Debugger)
3) Run the 68K Mac Debugger (or the Power Macintosh Debugger)
4) Select the Local option from the dialog that appears.
5) Select the .sym file (.xcoff or .xsym for Power PC) of the application to be debugged from the standard File Selection dialog.
6) Launch your application. Go to the Control Menu item Launch to launch your application (You may also hold down the Control key while double clicking on your application.). The Launch item in the Control menu puts you into another standard file selection dialog.
7)Select the application to be launched and click Open. This will target your application and open a register window.
8) If your application's name is different from the name of your sym file, you need to select the Map Symbolics to Code in the File menu (on the Power Macintosh Debugger use the Auto-Target preference). Usually, if your application is named "MyApp," your sym file will be "MyApp.xcoff," "MyApp.xsym," or "MyApp.sym" and you don't need to select the Map Symbolics to Code in the File menu.
9) Once your application has been targeted, you can select a source file and function to debug. After selecting a function, that function's code appears in the Code window with markers at statements where breakpoints may be set. Moving the cursor over a breakpoint marker causes the cursor to turn red (on color monitors) in the shape of a stop sign. Clicking on a breakpoint marker sets a breakpoint. If the breakpoint has a sad face, then your application has not yet been targeted, you have only set a place holder in the sym file. Quit the debugger and check to see that you have followed the preceding instructions exactly.
An easier way to target your application quickly is to insert a DebugStr("\p
Drop into the Debugger") or Debugger() statement as the first statement in your
main() routine. When this statement is executed your application will fall into
the 68K Mac Debugger or the Power Macintosh Debugger, depending on which is
running. The DebugStr() statement puts up a Log window displaying the string
that was passed. Dismissing the log window leaves you at the statement after
DebugStr() statement the in the Browser. The Debugger() statement simply stops
at the statement after Debugger() statement, without putting up a Log window.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help